﻿/** EasyWeb spa v3.1.5 date:2019-10-05 License By http://easyweb.vip */
layui.define(function (c) {
    var b = {
        version: "315",
        base_server: "json/",
        tableName: "easyweb-spa",
        pageTabs: !1,
        openTabCtxMenu: !0,
        maxTabNum: 20,
        viewPath: "components",
        viewSuffix: ".html",
        defaultTheme: "theme-admin",
        reqPutToPost: !0,
        cacheTab: !0,
        getToken: function () {
            var a = layui.data(b.tableName);
            if (a) return a.token
        },
        removeToken: function () {
            layui.data(b.tableName, {
                key: "token",
                remove: !0
            })
        },
        putToken: function (a) {
            layui.data(b.tableName, {
                key: "token",
                value: a
            })
        },
        getUser: function () {
            var a = layui.data(b.tableName);
            if (a) return a.login_user
        },
        putUser: function (a) {
            layui.data(b.tableName, {
                key: "login_user",
                value: a
            })
        },
        getUserAuths: function () {
            return []
        },
        getAjaxHeaders: function (a) {
            return []
        },
        ajaxSuccessBefore: function (a, c) {
            if (401 == a.code) return b.removeToken(), layer.msg("登录过期", {
                icon: 2,
                time: 1500
            }, function () {
                location.reload()
            }), !1;
            403 == a.code ? layer.msg("没有访问权限", {
                icon: 2
            }) : 404 == a.code && layer.msg("404访问不存在", {
                icon: 2
            });
            return !0
        },
        routerNotFound: function (a) {
            layer.alert("路由" + location.hash + "不存在", {
                title: "提示",
                skin: "layui-layer-admin",
                btn: [],
                offset: "30px",
                anim: 6,
                shadeClose: !0
            })
        }
    };
    layui.config({
        version: b.version
    });
    c("config", b)
});
